package com.itheima.bakery.demos.web.service;

import com.itheima.bakery.demos.web.model.CartItem;
import com.itheima.bakery.demos.web.model.Order;
import com.itheima.bakery.demos.web.model.OrderDetail;
import com.itheima.bakery.demos.web.model.ShippingAddress;
import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Optional;
import java.sql.Timestamp;
public interface OrderService {
    List<Order> findAllOrders();
    Optional<Order> findOrderById(Integer id);
    Order saveOrder(Order order);
    boolean deleteOrder(Integer id);
    void updateOrderTotal(Integer orderId);
    Integer createOrderAndDetails(Integer userId, List<CartItem> cartItems);
    List<OrderDetail> findOrderDetailsByOrderId(Integer orderId);
    Order updateOrderAddress(Integer orderId, Integer address_Id);
    void updateOrderStatus(Integer orderId, String status, String alipayNo, Timestamp payTime);
    Optional<ShippingAddress> getShippingAddressByOrderID(Integer orderID);
}